
<div class="form">
	<h2><?php echo CHtml::image($this->module->registerImage('article-new.png'),'Logo', array('width'=>'40'));?>&nbsp;&nbsp;添加新分类</h2>

	<?php $form=$this->beginWidget('CActiveForm', array(
		'id'=>'category-form',
		'enableAjaxValidation'=>false,
	)); ?>

	<?php if($this->action->id == "update"):?>
	<div class="cateImage" style="margin-top:-10px;">
		<?php if($model->isNewRecord):?>
		<img src="/images/2116900d4ff02d4ce63bfa4fc75e6435.jpg"  width="200"  id="cateFolder"/>
		<?php else:?>
		<img src="<?php echo Yii::app()->params['uploadCategoryPath'].$this->getCategoryName($_GET['id']);?>_thumb.jpg" id="cateFolder"  />
		<?php endif;?>
		<div class="cateImagedes"><a href="#gallery-items" id="gallery-show">更换</a> <a href="	<?php echo $this->createUrl(Category::model()->getAction($model->cate_type).'/category',array('id'=>$model->cate_id));?>">查看分类</a></div>
	</div>
	<?php endif;?>
	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'cate_name'); ?>
		<?php echo $form->textField($model,'cate_name',array('size'=>20,'maxlength'=>20,'style'=>'width:50%;')); ?>
		<?php echo $form->error($model,'cate_name'); ?>
	</div>
	
	<div class="row left " style="width:20%;margin-right:10px;">
		<?php echo $form->labelEx($model,'cate_type'); ?>
		<?php echo $form->dropDownList($model,'cate_type',array(Category::CATEGORY_STORY=>'文集',
																Category::CATEGORY_PAGE=>'单页',
																Category::CATEGORY_GALLERY=>'图库',
																Category::CATEGORY_FILE=>'文档',
																Category::CATEGORY_AUDIO=>'音频',
																Category::CATEGORY_VIDEO=>'视频'),
														array(
															'options'=>array($model->cate_type=>array('selected'=>true)),
															'style'=>'width:100%;'
														)); ?>
		<?php echo $form->error($model,'cate_type'); ?>
	</div>
	
	<div class="row left" style="width:20%;">
		<?php echo $form->labelEx($model,'cate_pid'); ?>
		<span style="width:20%;">
		<?php echo $form->dropDownList($model,'cate_pid',$cate,array(
				'options'=>array($model->cate_pid=>array('selected'=>true)),
				'style'=>'width:100%;'											
		)); ?>
		</span>
		<?php echo $form->error($model,'cate_pid'); ?>
	</div>
	<?php if($this->action->id == "update"):?>
	<br />	
	<?php endif;?>
	<div class="row <?php if($this->action->id == "update"):?>left<?php endif;?>" style="width:20%;">
		<?php echo $form->labelEx($model,'cate_recommend'); ?>
		<span style="width:20%;">
				<?php echo $form->dropDownList($model,'cate_recommend',array(
															Category::CATEGORY_RECOMMEND_SITE=>'推荐到首页',
															Category::CATEGORY_RECOMMEND_CHANNELS=>'推荐到频道',
															Category::CATEGORY_RECOMMEND_CANCEL=>'取消推荐'
				
														),
														array(
															'options'=>array($model->cate_recommend=>array('selected'=>true)),
															'style'=>'width:100%;'
														)); ?>
		</span>
		<?php echo $form->error($model,'cate_recommend'); ?>
	</div>
	<div class="row clear">
		<?php echo $form->labelEx($model,'cate_order'); ?>
		<?php echo $form->textField($model,'cate_order',array('style'=>'width:50%;')); ?>
		<?php echo $form->error($model,'cate_order'); ?>
	</div>

	<div class="row">

	</div>

	<div class="row buttons">
		<?php if($model->isNewRecord):?>
			<button type="button" id="cate_submit" class="right" >Create</button> 
		<?php else:?>
			<button type="submit" id="cate_submit" class="right" >Update</button> 
		<?php endif;?>	
	</div>
	

	<?php $this->endWidget(); ?>

</div><!-- form -->
